public class Book {
    // 声明类的属性（这是关键，之前缺失了这一步）
    private String isbn;
    private String title;
    private String author;
    private String publisher;
    private boolean isBorrowed;

    // 构造方法：初始化图书所有属性
    public Book(String isbn, String title, String author, String publisher) {
        this.isbn = isbn;
        this.title = title;
        this.author = author;
        this.publisher = publisher;
        this.isBorrowed = false; // 初始状态为“可借阅”
    }

    // Getter方法：获取各属性值
    public String getIsbn() { return isbn; }
    public String getTitle() { return title; }
    public boolean isBorrowed() { return isBorrowed; }

    // Setter方法：修改图书借出状态
    public void setBorrowed(boolean borrowed) { isBorrowed = borrowed; }

    // 重写toString：便于打印图书信息
    @Override
    public String toString() {
        return "ISBN：" + isbn + "，书名：" + title + "，作者：" + author + "，出版社：" + publisher + "，状态：" + (isBorrowed ? "已借出" : "可借阅");
    }
}
